package com.youfang.sixthmedia.message.chat;

import java.util.List;

import org.json.JSONObject;

import com.youfang.sixthmedia.net.MessageDelegate;
import com.youfang.sixthmedia.net.Pair;
import com.youfang.sixthmedia.net.Request;
import com.youfang.sixthmedia.net.Response;

public class GetUnReadMsgCntDelegate extends MessageDelegate {

	public static class Req extends Request {
		public int userid;

		@Override
		public List<Pair> getParams() {

			return Pair.p("controller", "message")
					.p("action", "GetUnReadMsgCnt").get();
		}

		@Override
		public void genMetaData() {

		}

	}

	public static class Resp extends Response {

		public int count;

		public boolean shouldShowLoginWhenNeedFailAuthed() {
			return false;
		}

		@Override
		protected void decodeBody(JSONObject bodyJSON) throws Exception {

			JSONObject o = bodyJSON.getJSONObject("data");
			count = o.getInt("count");

		}

	}

	public Req req = new Req();
	public Resp resp = new Resp();

	@Override
	public Request request() {
		return req;
	}

	@Override
	public Response response() {
		return resp;
	}

}
